<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp" %>

<!DOCTYPE html>
<html>
<head>
	<title>已处理调价明细</title>
	<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
	    <style type="text/css">

    div.col-sm-1.text-left,div.col-sm-2.text-left, div.col-sm-3.text-left, div.col-sm-10.text-left{
    color:#949494;
    }	
    </style>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>已处理调价明细</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
			<li class="active"><a href="#">交易</a></li>
			<li class="active"><a href="#">药品调价</a></li>
            <li class="active"><a href="#">已处理调价计划</a></li>
        </ol>
    </section>
    
    <section class="content">
    <table class="infoBox">
      <tr>
        <td width="150px" class="infoBoxleft">
        <p style="color:#fff;font-size:20px;text-align:center;font-weight:600">调价信息</p>
        </td>
        <td>
        	<form role="form" class="form-horizontal" action="${ctx }/stdDrug/editInfo.html" method="post">
                <div class="box-body" style="background:url('${ctx }/lib/img/infobg.png') no-repeat bottom right;">               
                    <div class="form-group form-group-xs margintop-xs"  style="margin-top:5px;">
                        <label class="col-sm-2 text-right" >计划名称：</label>
                        <div class="col-sm-2 text-left" >
                        ${plan.priceAdjPlanName }
                        </div>
                         <label class="col-sm-1 text-right margintop-xs" for="txtDrugForm">制定时间：</label>
                        <div class="col-sm-3 text-left" >
                           ${plan.createDatetime }	
                        </div>
                         <label class="col-sm-1 text-right margintop-xs">执行时间：</label>
                        <div class="col-sm-3 text-left">
                           ${plan.executeDatetime }
                        </div>
                    </div>
                    <div class="form-group form-group-xs" style="margin-top:-10px">
                         <label class="col-sm-2 text-right margintop-xs">执行方式：</label>
                        <div class="col-sm-2 text-left">
                          ${plan.executeCat }
                        </div>
                        <label class="col-sm-1 text-right margintop-xs">调价依据：</label>
                        <div class="col-sm-2 text-left">
                             ${plan.priceAdjAccord }
                        </div>
                    </div>                                        
                    <div class="form-group form-group-xs" style="margin-top:-10px;margin-bottom:-10px;">
                        <label class="col-sm-2 text-right margintop-xs" >备注：</label>
                        <div class="col-sm-10 text-left">
                            ${compGroup.remark }
                        </div>
                    </div>
                </div>
             </form>
        </td>
      </tr>
      </table>
        
		<div class=" box box-success">
            <div class="box-body">
            	<div class="input">
					<div class="textalign1">通用名：</div>
            		<div class="boxinput">
            			 <input class="textinput" type="text" id="drugName" placeholder="通用名" />
            		</div>
            		<div class="textalign1">药品编码：</div>
            		<div class="boxinput">
            			<input class="textinput" type="text" id="drugCode" placeholder="药品编码" />
            		</div>
					<div class="textalign1">生产企业：</div>
            		<div class="boxinput">
            			<input class="textinput" type="text" id="compName" placeholder="生产企业" />
            		</div>
            		<div class="textalign1">
            			<button type="button" onclick="likeQuery();" class="btn btn-success btn-sm" id="selectc"> 查  询 </button>
            		</div>
            	</div>
            </div>
        </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        <div class=" box box-warning bottongroup">
            <button type="button" class="btn btn-danger btn-sm" onclick='history.go(-1)'>返 回</button>
        </div>

    </section>
   <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
    	
	  //绑定回车
	    $('#drugCode,#drugName,#compName').bind('keydown', function(event) {
	        if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
	            $('#selectc').click();
	        }
	    }); 
			
	    $("#drugName").focus();//加载页面光标在第一个查询框内
    
        $(function () {
            $("#gridlist").jqGrid({
                url: "${ctx}/wsjPriceAdjust/getPriceDetailList.html",
                mtype: "POST",
                datatype: "json",
                postData:{"priceAdjPlanId":"${priceAdjPlanId}"},
                shrinkToFit: true,
              //  height: 270,
                colNames: ['商品编码','采购限价', '新采购限价', '最高零售限价', '新最高零售限价','药品编码', '通用名',  '剂型', '规格', '转换系数', '单位', '材质', '生产企业', '所属项目','生产企业ID','药品ID'],
                colModel: [
					{ name: 'goodsCode', width: 100,align: 'center',hidden:true,sortable:false},
					{ name: 'origProPriceLimit', width: 100, align: "right",sortable:false,
						formatter : function(val, opts, rowdata){
							if(val != null && val != ""){
								return formatAmount(val, opts, rowdata);
							}
							return "";
						}	
                    },
                    { name: 'currProPriceLimit', width: 100, align: "right",sortable:false,
                    	formatter : function(val, opts, rowdata){
                    		if(val != null && val != ""){
								return formatAmount(val, opts, rowdata);
							}
							return "";
						}	
                    },
                    { name: 'origRetailPriceLimit', width: 100, align: "right",sortable:false,
                    	formatter : function(val, opts, rowdata){
                    		if(val != null && val != ""){
								return formatAmount(val, opts, rowdata);
							}
							return "";
						}	
                    },
                    { name: 'currRetailPriceLlimit', width: 100, align: "right",sortable:false,
                    	formatter : function(val, opts, rowdata){
                    		if(val != null && val != ""){
								return formatAmount(val, opts, rowdata);
							}
							return "";
						}	
                    },
					{ name: 'drugCode', width: 120,align: 'center',sortable:false,
					    formatter:function(cellvalue, options, row) {
					    	return "<a href=\"javascript:void(0)\" onclick=\"showDrugInfo('"+row.drugCode+"','"+row.drugName+"')\">"+cellvalue+"</a>";
                    	}
					},
                    { name: 'drugName', width: 100,align: 'center',sortable:false },
                    { name: 'formName', width: 80 ,align: 'center',sortable:false },
                    { name: 'specName', width: 80 ,align: 'left',sortable:false },
                    { name: 'factor', width: 60,align: 'center',sortable:false },
                    { name: 'unit', width: 50 ,align: 'center',sortable:false },
					{ name: 'materialName', width: 50 ,align: 'center',sortable:false },
                    { name: 'compName', width: 180,align: 'center',sortable:false,
						formatter:function(cellvalue, options, row) {
							return "<a href=\"javascript:void(0)\" onclick=\"showCompInfo('"+row.prodCompId+"','"+row.compName+"')\">"+cellvalue+"</a>";
                    	}
					},
                    { name: 'name', width: 180,align: 'center',hidden:true,sortable:false },
					{ name: 'prodCompId',index: 'prodCompId', hidden:true, width: 120,align: 'center',sortable:false},
					{ name: 'drugId',index: 'drugId', hidden:true, width: 120,align: 'center',sortable:false}
                ],
                rowNum: 20,
                rowList: [10, 20, 50, 100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                caption: "已处理调价明细",
                gridComplete:function(){
                    //序号列宽度自适应（参数为jqgridID）
                    autoRNWidth("gridlist");
                    //数据只有一条时默认选中（参数为jqgridID）
                    selectByOneData("gridlist");
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
			$("#gridlist").jqGrid("setGridHeight",create());
        });
		
		function likeQuery() {
    		var goodsCode = $.trim($("#goodsCode").val());
    		var drugCode = $.trim($("#drugCode").val());
    		var drugName = $.trim($("#drugName").val());
    		var compName = $.trim($("#compName").val());
			var projName = $.trim($("#projName").val());
			$("#gridlist").jqGrid('setGridParam',{
       	    	datatype:'json',
                postData:{
                	"goodsCode":goodsCode,
                	"drugCode":drugCode,
                	"drugName":drugName,
                	"compName":compName,
                	"projName":projName
                },
                page : 1
			}).trigger("reloadGrid");
		}
    </script>
</body>
</html>

